# -*- coding: utf-8 -*-
from django.db import models

# Create your models here.
class UserInfo(models.Model):
    username=models.CharField(max_length=30)
    province=models.CharField(max_length=10,blank=True)
    city=models.CharField(max_length=10,blank=True)
    location=models.CharField(max_length=60,blank=True)
    profile_image=models.ImageField(upload_to='usericon/')
    gender=models.CharField(max_length=5,blank=True)
    friends=models.TextField(blank=True,null=True)
    clb_friends=models.TextField(blank=True,null=True)
    
    def __unicode__(self):       
        #return u'%s %s %s %s %s %s %s' % (self.username,self.city,self.location,self.profile_image,self.province,self.gender,self.friends)
        return self.username
    
    class Meta:
        ordering=['username']
    
    class Admin:
        pass

class Province(models.Model):
    province_id=models.CharField(max_length=5)
    province_name=models.CharField(max_length=30)
    city_id=models.CharField(max_length=5)
    city_name=models.CharField(max_length=30)
    
    def __unicode__(self):
        return self.city_name
    
    class Meta:
        ordering=['province_id']
        
    class Admin:
        pass